import sqlite3
conn = sqlite3.connect('test.db')

cursor = conn.cursor()
ret = cursor.execute('create table if not exists user(id varchar(20) primary key,name varchar(20))')
print cursor.rowcount, type(ret)
ret =cursor.execute('insert into user (id, name) values (\'1\', \'Michael\')')
print cursor.rowcount, type(ret)
cursor.close()


cursor = conn.cursor()
ret = cursor.execute("select * from user")

print type(cursor), type(ret)
print cursor.fetchall()
#for it in cursor:
#    print it

conn.execute("drop table user")


conn.commit()
conn.close()




